//
//  SinaWriteButton.swift
//  MySinaWeiBoSwiftProject
//
//  Created by apple on 2016/11/21.
//  Copyright © 2016年 WangChen. All rights reserved.
//

import UIKit

class SinaWriteButton: UIButton {
    
    let imageW: CGFloat = 80
    let btnW: CGFloat = 80
    let btnH: CGFloat = 110
    
    
    //重写初始化方法
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.titleLabel?.textAlignment = .center
        self.titleLabel?.font = UIFont.systemFont(ofSize: 14)
        self.setTitleColor(UIColor.darkGray, for: .normal)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    override func imageRect(forContentRect contentRect: CGRect) -> CGRect {
        return CGRect(x: 0, y: 0, width: imageW, height: imageW)
    }
    
    
    override func titleRect(forContentRect contentRect: CGRect) -> CGRect {
        return CGRect(x: 0, y: imageW, width: btnW, height: btnH - imageW)
    }
    
    
    

}
